package com.google.android.vending.expansion.downloader.impl;

import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Build.VERSION;
import android.widget.RemoteViews;
import com.android.vending.expansion.downloader.R.id;
import com.android.vending.expansion.downloader.R.layout;
import com.android.vending.expansion.downloader.R.string;
import com.google.android.vending.expansion.downloader.Helpers;

public class V3CustomNotification
  implements DownloadNotification.ICustomNotification
{
  long mCurrentBytes = -1L;
  int mIcon;
  Notification mNotification = new Notification();
  PendingIntent mPendingIntent;
  CharSequence mTicker;
  long mTimeRemaining;
  CharSequence mTitle;
  long mTotalBytes = -1L;

  public void setCurrentBytes(long paramLong)
  {
    this.mCurrentBytes = paramLong;
  }

  public void setIcon(int paramInt)
  {
    this.mIcon = paramInt;
  }

  public void setPendingIntent(PendingIntent paramPendingIntent)
  {
    this.mPendingIntent = paramPendingIntent;
  }

  public void setTicker(CharSequence paramCharSequence)
  {
    this.mTicker = paramCharSequence;
  }

  public void setTimeRemaining(long paramLong)
  {
    this.mTimeRemaining = paramLong;
  }

  public void setTitle(CharSequence paramCharSequence)
  {
    this.mTitle = paramCharSequence;
  }

  public void setTotalBytes(long paramLong)
  {
    this.mTotalBytes = paramLong;
  }

  public Notification updateNotification(Context paramContext)
  {
    Notification localNotification = this.mNotification;
    localNotification.icon = this.mIcon;
    localNotification.flags = (0x2 | localNotification.flags);
    if (Build.VERSION.SDK_INT > 10)
      localNotification.flags = (0x8 | localNotification.flags);
    RemoteViews localRemoteViews = new RemoteViews(paramContext.getPackageName(), R.layout.status_bar_ongoing_event_progress_bar);
    localRemoteViews.setTextViewText(R.id.title, this.mTitle);
    localRemoteViews.setViewVisibility(R.id.description, 0);
    localRemoteViews.setTextViewText(R.id.description, Helpers.getDownloadProgressString(this.mCurrentBytes, this.mTotalBytes));
    localRemoteViews.setViewVisibility(R.id.progress_bar_frame, 0);
    int i = R.id.progress_bar;
    int j = (int)(this.mTotalBytes >> 8);
    int k = (int)(this.mCurrentBytes >> 8);
    if (this.mTotalBytes <= 0L);
    for (boolean bool = true; ; bool = false)
    {
      localRemoteViews.setProgressBar(i, j, k, bool);
      localRemoteViews.setViewVisibility(R.id.time_remaining, 0);
      int m = R.id.time_remaining;
      int n = R.string.time_remaining_notification;
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = Helpers.getTimeRemaining(this.mTimeRemaining);
      localRemoteViews.setTextViewText(m, paramContext.getString(n, arrayOfObject));
      localRemoteViews.setTextViewText(R.id.progress_text, Helpers.getDownloadProgressPercent(this.mCurrentBytes, this.mTotalBytes));
      localRemoteViews.setImageViewResource(R.id.appIcon, this.mIcon);
      localNotification.contentView = localRemoteViews;
      localNotification.contentIntent = this.mPendingIntent;
      return localNotification;
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.google.android.vending.expansion.downloader.impl.V3CustomNotification
 * JD-Core Version:    0.6.2
 */